home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / science / ack3d.zip / ACKWRAP.C < prev    next >
Text File  |  1994-01-09  |  2KB  |  62 lines

  1. /******************* ( Animation Construction Kit 3D ) ***********************/
  2. /*                Wrapup Routines                     */
  3. /* CopyRight (c) 1993       Author: Lary Myers                     */
  4. /*****************************************************************************/
  5.  
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <dos.h>
  9. #include <mem.h>
  10. #include <alloc.h>
  11. #include <io.h>
  12. #include <fcntl.h>
  13. #include <time.h>
  14. #include <string.h>
  15. #include <sys\stat.h>
  16. #include "ack3d.h"
  17. #include "ackeng.h"
  18. #include "ackext.h"
  19. #include "xmslib.h"
  20.  
  21. /****************************************************************************
  22. ** This routine **MUST** be called by the application prior to exiting to  **
  23. ** allow XMS memory to be returned to the system. Failure to do so will       **
  24. ** cause the XMS memory to become unavailable to other applications.       **
  25. **                                       **
  26. ****************************************************************************/
  27. int AckWrapUp(ACKENG *ae)
  28. {
  29.  
  30. free(LongTanTable);
  31. free(LongInvTanTable);
  32. free(CosTable);
  33. free(SinTable);
  34. free(InvSinTable);
  35. free(InvCosTable);
  36. free(LongCosTable);
  37. free(xNextTable);
  38. free(yNextTable);
  39. free(ViewCosTable);
  40. free(AdjustTable);
  41.  
  42. if (ae->OverlayBuffer != NULL)
  43.     free(ae->OverlayBuffer);
  44. ae->OverlayBuffer = NULL;
  45.  
  46. if (ae->BkgdBuffer != NULL)
  47.     free(ae->BkgdBuffer);
  48. ae->BkgdBuffer = NULL;
  49.  
  50. if (ae->ScreenBuffer != NULL)
  51.     free(ae->ScreenBuffer);
  52. ae->ScreenBuffer = NULL;
  53.  
  54. #if USE_XMS
  55.     if (UseXMS)
  56.     XMSclose();
  57. #endif
  58.  
  59. return(0);
  60. }
  61.  
  62.